Integrand size = 26, antiderivative size = 179 \[ \int \frac {d+e x+f x^2+g x^3}{\left (1+x^2+x^4\right )^2} \, dx=\frac {x \left (d+f-(d-2 f) x^2\right )}{6 \left (1+x^2+x^4\right )}+\frac {e-2 g+(2 e-g) x^2}{6 \left (1+x^2+x^4\right )}-\frac {(4 d+f) \arctan \left (\frac {1-2 x}{\sqrt {3}}\right )}{12 \sqrt {3}}+\frac {(4 d+f) \arctan \left (\frac {1+2 x}{\sqrt {3}}\right )}{12 \sqrt {3}}+\frac {(2 e-g) \arctan \left (\frac {1+2 x^2}{\sqrt {3}}\right )}{3 \sqrt {3}}-\frac {1}{8} (2 d-f) \log \left (1-x+x^2\right )+\frac {1}{8} (2 d-f) \log \left (1+x+x^2\right ) \]
[Out]
Time = 0.10 (sec) , antiderivative size = 179, normalized size of antiderivative = 1.00, number of steps used = 15, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.346, Rules used = {1687, 1192, 1183, 648, 632, 210, 642, 1261, 652} \[ \int \frac {d+e x+f x^2+g x^3}{\left (1+x^2+x^4\right )^2} \, dx=-\frac {\arctan \left (\frac {1-2 x}{\sqrt {3}}\right ) (4 d+f)}{12 \sqrt {3}}+\frac {\arctan \left (\frac {2 x+1}{\sqrt {3}}\right ) (4 d+f)}{12 \sqrt {3}}+\frac {\arctan \left (\frac {2 x^2+1}{\sqrt {3}}\right ) (2 e-g)}{3 \sqrt {3}}-\frac {1}{8} (2 d-f) \log \left (x^2-x+1\right )+\frac {1}{8} (2 d-f) \log \left (x^2+x+1\right )+\frac {x \left (-\left (x^2 (d-2 f)\right )+d+f\right )}{6 \left (x^4+x^2+1\right )}+\frac {x^2 (2 e-g)+e-2 g}{6 \left (x^4+x^2+1\right )} \]
[In]
[Out]
Rule 210
Rule 632
Rule 642
Rule 648
Rule 652
Rule 1183
Rule 1192
Rule 1261
Rule 1687
Rubi steps \begin{align*} \text {integral}& = \int \frac {d+f x^2}{\left (1+x^2+x^4\right )^2} \, dx+\int \frac {x \left (e+g x^2\right )}{\left (1+x^2+x^4\right )^2} \, dx \\ & = \frac {x \left (d+f-(d-2 f) x^2\right )}{6 \left (1+x^2+x^4\right )}+\frac {1}{6} \int \frac {5 d-f+(-d+2 f) x^2}{1+x^2+x^4} \, dx+\frac {1}{2} \text {Subst}\left (\int \frac {e+g x}{\left (1+x+x^2\right )^2} \, dx,x,x^2\right ) \\ & = \frac {x \left (d+f-(d-2 f) x^2\right )}{6 \left (1+x^2+x^4\right )}+\frac {e-2 g+(2 e-g) x^2}{6 \left (1+x^2+x^4\right )}+\frac {1}{12} \int \frac {5 d-f-(6 d-3 f) x}{1-x+x^2} \, dx+\frac {1}{12} \int \frac {5 d-f+(6 d-3 f) x}{1+x+x^2} \, dx+\frac {1}{6} (2 e-g) \text {Subst}\left (\int \frac {1}{1+x+x^2} \, dx,x,x^2\right ) \\ & = \frac {x \left (d+f-(d-2 f) x^2\right )}{6 \left (1+x^2+x^4\right )}+\frac {e-2 g+(2 e-g) x^2}{6 \left (1+x^2+x^4\right )}+\frac {1}{8} (2 d-f) \int \frac {1+2 x}{1+x+x^2} \, dx+\frac {1}{8} (-2 d+f) \int \frac {-1+2 x}{1-x+x^2} \, dx+\frac {1}{24} (4 d+f) \int \frac {1}{1-x+x^2} \, dx+\frac {1}{24} (4 d+f) \int \frac {1}{1+x+x^2} \, dx+\frac {1}{3} (-2 e+g) \text {Subst}\left (\int \frac {1}{-3-x^2} \, dx,x,1+2 x^2\right ) \\ & = \frac {x \left (d+f-(d-2 f) x^2\right )}{6 \left (1+x^2+x^4\right )}+\frac {e-2 g+(2 e-g) x^2}{6 \left (1+x^2+x^4\right )}+\frac {(2 e-g) \tan ^{-1}\left (\frac {1+2 x^2}{\sqrt {3}}\right )}{3 \sqrt {3}}-\frac {1}{8} (2 d-f) \log \left (1-x+x^2\right )+\frac {1}{8} (2 d-f) \log \left (1+x+x^2\right )+\frac {1}{12} (-4 d-f) \text {Subst}\left (\int \frac {1}{-3-x^2} \, dx,x,-1+2 x\right )+\frac {1}{12} (-4 d-f) \text {Subst}\left (\int \frac {1}{-3-x^2} \, dx,x,1+2 x\right ) \\ & = \frac {x \left (d+f-(d-2 f) x^2\right )}{6 \left (1+x^2+x^4\right )}+\frac {e-2 g+(2 e-g) x^2}{6 \left (1+x^2+x^4\right )}-\frac {(4 d+f) \tan ^{-1}\left (\frac {1-2 x}{\sqrt {3}}\right )}{12 \sqrt {3}}+\frac {(4 d+f) \tan ^{-1}\left (\frac {1+2 x}{\sqrt {3}}\right )}{12 \sqrt {3}}+\frac {(2 e-g) \tan ^{-1}\left (\frac {1+2 x^2}{\sqrt {3}}\right )}{3 \sqrt {3}}-\frac {1}{8} (2 d-f) \log \left (1-x+x^2\right )+\frac {1}{8} (2 d-f) \log \left (1+x+x^2\right ) \\ \end{align*}
Result contains complex when optimal does not.
Time = 0.27 (sec) , antiderivative size = 200, normalized size of antiderivative = 1.12 \[ \int \frac {d+e x+f x^2+g x^3}{\left (1+x^2+x^4\right )^2} \, dx=\frac {1}{36} \left (\frac {6 \left (e+2 e x^2-g \left (2+x^2\right )+x \left (d+f-d x^2+2 f x^2\right )\right )}{1+x^2+x^4}-\frac {\left (\left (-11 i+\sqrt {3}\right ) d-2 \left (-2 i+\sqrt {3}\right ) f\right ) \arctan \left (\frac {1}{2} \left (-i+\sqrt {3}\right ) x\right )}{\sqrt {\frac {1}{6} \left (1+i \sqrt {3}\right )}}-\frac {\left (\left (11 i+\sqrt {3}\right ) d-2 \left (2 i+\sqrt {3}\right ) f\right ) \arctan \left (\frac {1}{2} \left (i+\sqrt {3}\right ) x\right )}{\sqrt {\frac {1}{6} \left (1-i \sqrt {3}\right )}}-4 \sqrt {3} (2 e-g) \arctan \left (\frac {\sqrt {3}}{1+2 x^2}\right )\right ) \]
[In]
[Out]
Time = 0.28 (sec) , antiderivative size = 172, normalized size of antiderivative = 0.96
method | result | size |
default | \(-\frac {\left (\frac {d}{3}-\frac {e}{3}-\frac {g}{3}-\frac {2 f}{3}\right ) x -\frac {2 d}{3}-\frac {e}{3}+\frac {2 g}{3}+\frac {f}{3}}{4 \left (x^{2}-x +1\right )}-\frac {\left (6 d -3 f \right ) \ln \left (x^{2}-x +1\right )}{24}-\frac {\left (-2 d -4 e -\frac {f}{2}+2 g \right ) \sqrt {3}\, \arctan \left (\frac {\left (2 x -1\right ) \sqrt {3}}{3}\right )}{18}+\frac {\left (-\frac {d}{3}-\frac {e}{3}-\frac {g}{3}+\frac {2 f}{3}\right ) x -\frac {2 d}{3}+\frac {e}{3}-\frac {2 g}{3}+\frac {f}{3}}{4 x^{2}+4 x +4}+\frac {\left (6 d -3 f \right ) \ln \left (x^{2}+x +1\right )}{24}+\frac {\left (2 d -4 e +\frac {f}{2}+2 g \right ) \arctan \left (\frac {\left (1+2 x \right ) \sqrt {3}}{3}\right ) \sqrt {3}}{18}\) | \(172\) |
risch | \(\text {Expression too large to display}\) | \(28327\) |
[In]
[Out]
none
Time = 0.46 (sec) , antiderivative size = 239, normalized size of antiderivative = 1.34 \[ \int \frac {d+e x+f x^2+g x^3}{\left (1+x^2+x^4\right )^2} \, dx=-\frac {12 \, {\left (d - 2 \, f\right )} x^{3} - 12 \, {\left (2 \, e - g\right )} x^{2} - 2 \, \sqrt {3} {\left ({\left (4 \, d - 8 \, e + f + 4 \, g\right )} x^{4} + {\left (4 \, d - 8 \, e + f + 4 \, g\right )} x^{2} + 4 \, d - 8 \, e + f + 4 \, g\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x + 1\right )}\right ) - 2 \, \sqrt {3} {\left ({\left (4 \, d + 8 \, e + f - 4 \, g\right )} x^{4} + {\left (4 \, d + 8 \, e + f - 4 \, g\right )} x^{2} + 4 \, d + 8 \, e + f - 4 \, g\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )}\right ) - 12 \, {\left (d + f\right )} x - 9 \, {\left ({\left (2 \, d - f\right )} x^{4} + {\left (2 \, d - f\right )} x^{2} + 2 \, d - f\right )} \log \left (x^{2} + x + 1\right ) + 9 \, {\left ({\left (2 \, d - f\right )} x^{4} + {\left (2 \, d - f\right )} x^{2} + 2 \, d - f\right )} \log \left (x^{2} - x + 1\right ) - 12 \, e + 24 \, g}{72 \, {\left (x^{4} + x^{2} + 1\right )}} \]
[In]
[Out]
Timed out. \[ \int \frac {d+e x+f x^2+g x^3}{\left (1+x^2+x^4\right )^2} \, dx=\text {Timed out} \]
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 135, normalized size of antiderivative = 0.75 \[ \int \frac {d+e x+f x^2+g x^3}{\left (1+x^2+x^4\right )^2} \, dx=\frac {1}{36} \, \sqrt {3} {\left (4 \, d - 8 \, e + f + 4 \, g\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x + 1\right )}\right ) + \frac {1}{36} \, \sqrt {3} {\left (4 \, d + 8 \, e + f - 4 \, g\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )}\right ) + \frac {1}{8} \, {\left (2 \, d - f\right )} \log \left (x^{2} + x + 1\right ) - \frac {1}{8} \, {\left (2 \, d - f\right )} \log \left (x^{2} - x + 1\right ) - \frac {{\left (d - 2 \, f\right )} x^{3} - {\left (2 \, e - g\right )} x^{2} - {\left (d + f\right )} x - e + 2 \, g}{6 \, {\left (x^{4} + x^{2} + 1\right )}} \]
[In]
[Out]
none
Time = 0.33 (sec) , antiderivative size = 138, normalized size of antiderivative = 0.77 \[ \int \frac {d+e x+f x^2+g x^3}{\left (1+x^2+x^4\right )^2} \, dx=\frac {1}{36} \, \sqrt {3} {\left (4 \, d - 8 \, e + f + 4 \, g\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x + 1\right )}\right ) + \frac {1}{36} \, \sqrt {3} {\left (4 \, d + 8 \, e + f - 4 \, g\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )}\right ) + \frac {1}{8} \, {\left (2 \, d - f\right )} \log \left (x^{2} + x + 1\right ) - \frac {1}{8} \, {\left (2 \, d - f\right )} \log \left (x^{2} - x + 1\right ) - \frac {d x^{3} - 2 \, f x^{3} - 2 \, e x^{2} + g x^{2} - d x - f x - e + 2 \, g}{6 \, {\left (x^{4} + x^{2} + 1\right )}} \]
[In]
[Out]
Time = 8.14 (sec) , antiderivative size = 237, normalized size of antiderivative = 1.32 \[ \int \frac {d+e x+f x^2+g x^3}{\left (1+x^2+x^4\right )^2} \, dx=\frac {\left (\frac {f}{3}-\frac {d}{6}\right )\,x^3+\left (\frac {e}{3}-\frac {g}{6}\right )\,x^2+\left (\frac {d}{6}+\frac {f}{6}\right )\,x+\frac {e}{6}-\frac {g}{3}}{x^4+x^2+1}-\ln \left (x-\frac {1}{2}-\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (\frac {d}{4}-\frac {f}{8}+\frac {\sqrt {3}\,d\,1{}\mathrm {i}}{18}+\frac {\sqrt {3}\,e\,1{}\mathrm {i}}{9}+\frac {\sqrt {3}\,f\,1{}\mathrm {i}}{72}-\frac {\sqrt {3}\,g\,1{}\mathrm {i}}{18}\right )-\ln \left (x+\frac {1}{2}-\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (\frac {f}{8}-\frac {d}{4}+\frac {\sqrt {3}\,d\,1{}\mathrm {i}}{18}-\frac {\sqrt {3}\,e\,1{}\mathrm {i}}{9}+\frac {\sqrt {3}\,f\,1{}\mathrm {i}}{72}+\frac {\sqrt {3}\,g\,1{}\mathrm {i}}{18}\right )+\ln \left (x-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (\frac {f}{8}-\frac {d}{4}+\frac {\sqrt {3}\,d\,1{}\mathrm {i}}{18}+\frac {\sqrt {3}\,e\,1{}\mathrm {i}}{9}+\frac {\sqrt {3}\,f\,1{}\mathrm {i}}{72}-\frac {\sqrt {3}\,g\,1{}\mathrm {i}}{18}\right )+\ln \left (x+\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (\frac {d}{4}-\frac {f}{8}+\frac {\sqrt {3}\,d\,1{}\mathrm {i}}{18}-\frac {\sqrt {3}\,e\,1{}\mathrm {i}}{9}+\frac {\sqrt {3}\,f\,1{}\mathrm {i}}{72}+\frac {\sqrt {3}\,g\,1{}\mathrm {i}}{18}\right ) \]
[In]
[Out]